<?php
/**
* 收益模块Api Controller
*
* 收益模块Api Controller的注意及说明
* 以下use模块请不要互相伤害
*
* @author    xiecz <xiecz@yunys.com.cn>
* @copyright 2016 QuanZhouYunYiShang Inc.
*/
namespace App\Http\Controllers\Api\Statistics;

use Illuminate\Routing\Controller as BaseController;
use Response,Request;
use App\Services\Statistics\IncomeApi;

class IncomeController extends BaseController{
	function __construct(IncomeApi $incomeApi){
		$this->incomeApi	= $incomeApi;
		$this->middleware('transaction',['only'=>['applyWithdraw']]);
	}

	//获取用户余额收益
	function myIncomes(){
		$input 	= Request::all();
		$result = $this->incomeApi->myIncomes($input);
		return response()->json($result);
	}

	//图表数据
	function draw(){
		$input 	= Request::all();
		$result = $this->incomeApi->draw($input);
		return response()->json($result);
	}

	//收益明细
	function incomeStatement(){
		$input	= Request::all();
		$result = $this->incomeApi->incomeStatement($input);
		return response()->json($result);
	}

	//提现记录
	function withdrawStatement(){
		$input 	= Request::all();
		$result = $this->incomeApi->withdrawStatement($input);
		return response()->json($result);
	}

	//申请提现页数据获取
	function getDataByApplyWithdraw(){
		$input 	= Request::all();
		$result = $this->incomeApi->getDataByApplyWithdraw($input);
		return response()->json($result);
	}

	//申请提现页数据获取
	function apply_withdraw_page(){
		$input  = Request::all();
		$result = $this->incomeApi->apply_withdraw_page($input);
		return response()->json($result);
	}

	//申请提现 3.2.1
	function apply_withdraw_new(){
		$input  = Request::all();
		$input['type'] = 5;
		$result = $this->incomeApi->apply_withdraw_new($input);
		return response()->json($result);
	}

	//申请提现
	function applyWithdraw(){
		$input	= Request::all();
		$result = $this->incomeApi->applyWithdraw($input);
		return response()->json($result);
	}

	function test(){
		$input	= Request::all();
		$result	= $this->incomeApi->test($input);
		return $result;
	}
}
